<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>不规则画廊布局</title>
    <style>
      .grid-container {
        width: 1000px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 200px 150px 60px 200px;
        grid-template-areas:
          "a a b"
          "c d b"
          "e d b"
          "e f g";
        gap: 10px;
      }

      .grid-item:nth-child(1) {
        grid-area: a;
        background-color: red;
      }

      .grid-item:nth-child(2) {
        grid-area: b;
        background-color: yellow;
      }

      .grid-item:nth-child(3) {
        grid-area: c;
        background-color: green;
      }

      .grid-item:nth-child(4) {
        grid-area: d;
        background-color: blue;
      }

      .grid-item:nth-child(5) {
        grid-area: e;
        background-color: orange;
      }

      .grid-item:nth-child(6) {
        grid-area: f;
        background-color: pink;
      }

      .grid-item:nth-child(7) {
        grid-area: g;
        background-color: khaki;
      }

      .grid-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    </style>
  </head>
  <body>
    <div class="grid-container">
      <div class="grid-item">
        <img src="https://picsum.photos/600/200?random=1" alt="image" />
      </div>
      <div class="grid-item">
        <img src="https://picsum.photos/400/900?random=2" alt="image" />
      </div>
      <div class="grid-item">
        <img src="https://picsum.photos/400/200?random=3" alt="image" />
      </div>
      <div class="grid-item">
        <img src="https://picsum.photos/400?random=4" alt="image" />
      </div>
      <div class="grid-item">
        <img src="https://picsum.photos/400/500?random=5" alt="image" />
      </div>
      <div class="grid-item">
        <img src="https://picsum.photos/400?random=6" alt="image" />
      </div>
      <div class="grid-item">
        <img src="https://picsum.photos/400?random=7" alt="image" />
      </div>
    </div>
  </body>
</html>
